package com.作业.Day15;

import java.io.*;

public class Homework4 {
    public static void main(String[] args) {
        try (BufferedReader bufferedReader = new BufferedReader(new FileReader("text4.txt"));
             BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter("text5.txt"))
        ) {
            char[] chars = new char[2];
            int len=0;
            while (( len=bufferedReader.read(chars))!=-1){
                System.out.print(new String(chars,0,len));
                bufferedWriter.write(chars);
            }


        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
